﻿using BonjourQuotation.DataAccess.Repositories;
using BonjourQuotation.ObjectModel.AccountData;
using BonjourQuotation.ObjectModel.ErrorData;
using BonjourQuotation.ObjectModel.SetupData;
using BonjourQuotation.ObjectModel.LoggerData;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace BonjourQuotation.UI.ServiceManagers
{
    public class SetupManager
    {
        private readonly log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
        #region ManageQuotationManager
        public SetupManageQuotationsGridBData LoadManageQuotations(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadManageQuotations(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupManageQuotationsGridBData LoadSearchedManageQuotations(SetupManageQuotationsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedManageQuotations(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveManageQuotationDetailsData(SetupManageQuotationsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveManageQuotationDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region ManageQuotationGroupsManager
        public SetupManageQuotationGroupsGridBData LoadManageQuotationGroups(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadManageQuotationGroups(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupManageQuotationGroupsGridBData LoadSearchedManageQuotationGroups(SetupManageQuotationGroupsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedManageQuotationGroups(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveManageQuotationGroupDetailsData(SetupManageQuotationGroupsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveManageQuotationGroupDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region RegionManager
        public ErrorBInfo CreateRegion(SetupRegionsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateRegion(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupRegionsGridBData LoadRegions(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadRegions(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteRegionById(int RegionID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteRegionById(RegionID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupRegionsGridBData LoadSearchedRegions(SetupRegionsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedRegions(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveRegionDetailsData(SetupRegionsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveRegionDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region StateManager
        public ErrorBInfo CreateState(SetupStatesGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateState(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupStatesGridBData LoadStates(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadStates(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteStateById(int StID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteStateById(StID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupStatesGridBData LoadSearchedStates(SetupStatesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedStates(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveStateDetailsData(SetupStatesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveStateDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region VendorTypeManager
        public ErrorBInfo CreateVendorType(SetupVendorTypesGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateVendorType(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupVendorTypesGridBData LoadVendorTypes(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadVendorTypes(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteVendorTypeById(int VendorTypeID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteVendorTypeById(VendorTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupVendorTypesGridBData LoadSearchedVendorTypes(SetupVendorTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedVendorTypes(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveVendorTypeDetailsData(SetupVendorTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveVendorTypeDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region DetailTypeManager
        public ErrorBInfo CreateDetailType(SetupDetailTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateDetailType(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupDetailTypesGridBData LoadDetailTypes(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadDetailTypes(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteDetailTypeById(int DetailTypeID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteDetailTypeById(DetailTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupDetailTypesGridBData LoadSearchedDetailTypes(SetupDetailTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedDetailTypes(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveDetailTypeDetailsData(SetupDetailTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveDetailTypeDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region PaymentTypeManager
        public ErrorBInfo CreatePaymentType(SetupPaymentTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreatePaymentType(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupPaymentTypesGridBData LoadPaymentTypes(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadPaymentTypes(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeletePaymentTypeById(int PaymentTypeID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeletePaymentTypeById(PaymentTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupPaymentTypesGridBData LoadSearchedPaymentTypes(SetupPaymentTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedPaymentTypes(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SavePaymentTypeDetailsData(SetupPaymentTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SavePaymentTypeDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region CountryManager
        public ErrorBInfo CreateCountry(SetupCountriesGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateCountry(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCountriesGridBData LoadCountries(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadCountries(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteCountryById(int CountryID) 
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteCountryById(CountryID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCountriesGridBData LoadSearchedCountries(SetupCountriesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedCountries(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveCountryDetailsData(SetupCountriesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveCountryDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region AreaManager
        public ErrorBInfo CreateArea(SetupAreasGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateArea(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupAreasGridBData LoadAreas(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadAreas(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteAreaById(int AreaID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteAreaById(AreaID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupAreasGridBData LoadSearchedAreas(SetupAreasGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedAreas(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveAreaDetailsData(SetupAreasGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveAreaDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region ServiceManager
        public ErrorBInfo CreateService(SetupServicesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateService(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupServicesGridBData LoadServices(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadServices(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteServiceById(int ServiceID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteServiceById(ServiceID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupServicesGridBData LoadSearchedServices(SetupServicesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedServices(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveServiceDetailsData(SetupServicesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveServiceDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region ServiceTypeManager
        public ErrorBInfo CreateServiceType(SetupServiceTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateServiceType(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupServiceTypesGridBData LoadServiceTypes(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadServiceTypes(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteServiceTypeById(int ServiceTypeID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteServiceTypeById(ServiceTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupServiceTypesGridBData LoadSearchedServiceTypes(SetupServiceTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedServiceTypes(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveServiceTypeDetailsData(SetupServiceTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveServiceTypeDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region BankManager
        public ErrorBInfo CreateBank(SetupBankDetailsBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateBank(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupBanksGridBData LoadAllBanks(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadAllBanks(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteBankById(int BankID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteBankById(BankID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupBanksGridBData LoadSearchedBanks(SetupBanksGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedBanks(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupBankDetailsBData LoadBankDetailsByID(int BankID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadBankDetailsByID(BankID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveBankDetailsData(SetupBankDetailsBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveBankDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region CompanyManager
        public ErrorBInfo CreateCompany(SetupCompanyDetailsBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateCompany(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCompaniesGridBData LoadAllCompanies(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadAllCompanies(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCompaniesGridBData LoadSearchedCompanies(SetupCompaniesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedCompanies(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteCompanyById(int CompanyID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteCompanyById(CompanyID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCompanyDetailsBData LoadCompanyDetailsByID(int CompanyID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadCompanyDetailsByID(CompanyID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveCompanyDetailsData(SetupCompanyDetailsBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveCompanyDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region DetailManager
        public ErrorBInfo CreateDetail(SetupDetailsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateDetail(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupDetailsGridBData LoadDetails(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadDetails(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupDetailsGridBData LoadSearchedDetails(SetupDetailsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedDetails(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteDetailById(int DetailID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteDetailById(DetailID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public Dictionary<int, string> GetServiceTypes(int DetailTypeID) 
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.GetServiceTypes(DetailTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveDetailDetailsData(SetupDetailsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveDetailDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region CityManager
        public ErrorBInfo CreateCity(SetupCitiesGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateCity(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCitiesGridBData LoadCities(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadCities(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteCityById(int CityID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteCityById(CityID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCitiesGridBData LoadSearchedCities(SetupCitiesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedCities(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveCityDetailsData(SetupCitiesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveCityDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCitiesGridRowBData LoadAddCityDetails()
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadAddCityDetails();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region QuotaRegionManager
        public ErrorBInfo CreateQuotaRegion(SetupQuotaRegionsGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateQuotaRegion(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupQuotaRegionsGridBData LoadQuotaRegions(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadQuotaRegions(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteQuotaRegionById(int QuotaRegionID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteQuotaRegionById(QuotaRegionID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupQuotaRegionsGridBData LoadSearchedQuotaRegions(SetupQuotaRegionsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedQuotaRegions(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveQuotaRegionDetailsData(SetupQuotaRegionsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveQuotaRegionDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region CardManager
        public ErrorBInfo CreateCard(SetupCardsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateCard(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCardsGridBData LoadCards(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadCards(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteCardById(int CardID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteCardById(CardID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupCardsGridBData LoadSearchedCards(SetupCardsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedCards(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveCardDetailsData(SetupCardsGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveCardDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region TechTypeManager
        public ErrorBInfo CreateTechType(SetupTechTypesGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateTechType(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupTechTypesGridBData LoadTechTypes(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadTechTypes(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteTechTypeById(int TechTypeID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteTechTypeById(TechTypeID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupTechTypesGridBData LoadSearchedTechTypes(SetupTechTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedTechTypes(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveTechTypeDetailsData(SetupTechTypesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveTechTypeDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region VConfStatusManager
        public ErrorBInfo CreateVConfStatus(SetupVConfStatusGridRowBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateVConfStatus(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupVConfStatusGridBData LoadVConfStatus(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadVConfStatus(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo DeleteVConfStatusById(int StatusID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteVConfStatusById(StatusID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public SetupVConfStatusGridBData LoadSearchedVConfStatus(SetupVConfStatusGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedVConfStatus(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public ErrorBInfo SaveVConfStatusDetailsData(SetupVConfStatusGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveVConfStatusDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        #endregion
        #region SpecialDatesManager
        public ErrorBInfo CreateSpecialDate(SetupSpecialDatesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.CreateSpecialDate(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public SetupSpecialDatesGridBData LoadSpecialDates(int PageNumber)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSpecialDates(PageNumber);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public SetupSpecialDatesGridBData LoadSearchedSpecialDates(SetupSpecialDatesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadSearchedSpecialDates(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public ErrorBInfo DeleteSpecialDateById(int SpecialDatesID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.DeleteSpecialDateById(SpecialDatesID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public Dictionary<int, string> GetCity(int? CountryID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.GetCity(CountryID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        public ErrorBInfo SaveSpecialDatesDetailsData(SetupSpecialDatesGridBData Data)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.SaveSpecialDatesDetailsData(Data);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }
        }
        #endregion
        public Dictionary<string, string> LoadState()
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadState();
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
        public Dictionary<int, string> LoadCity(int CountryID, string StateID)
        {
            try
            {
                var proxy = new SetupRepository();
                return proxy.LoadCity(CountryID, StateID);
            }
            catch (Exception ex)
            {
                logger.Error(ex.ToMessageAndCompleteStacktrace());
                return null;
            }  
        }
    }
}